package com.panasonic.cn.cmsc.pc;

import java.io.*;
import java.lang.*;
import java.util.*;
import java.math.*;
import java.sql.SQLException;
import com.fujitsu.fks.jaaf.core.*;

public class SQLMM03_CHANGELIST{
	private Hashtable paramsString     = new Hashtable();
	private Hashtable paramsBigDecimal = new Hashtable();
	private Hashtable paramsFree       = new Hashtable();
	private String lastSql_ = null;

	private String getString(String name){
		if(name==null) return "";
		String returnStr = (String)paramsString.get(name);
		if(returnStr==null) return "";
		return "'"+FrameworkCommon.stringReplaceSQuote(returnStr)+"'";
	}

	private String getBigDecimal(String name){
		if(name==null) return "";
		BigDecimal returnStr = (BigDecimal)paramsBigDecimal.get(name);
		if(returnStr==null) return "";
		return returnStr.toString();
	}

	private String getFree(String name){
		if(name==null) return "";
		String returnStr = (String)paramsFree.get(name);
		if(returnStr==null) return "";
		return returnStr;
	}

	public String getLastSql(){
		return lastSql_;
	}

	public SelectResultRset SELECT_M0301(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append("	SELECT ");
		sql.append("	NVL(SLCP_CD,'') AS SLCP_CD,");
		sql.append("	NVL(ITM_NO,'') AS ITM_NO,");
		sql.append("	NVL(APL_BDT,'') AS APL_BDT, ");
		sql.append("	NVL(APL_EDT,'') AS APL_EDT, ");
		sql.append("	NVL(GNR_ADM_NO,'') AS GNR_ADM_NO, ");
		sql.append("	NVL(TMP_AC_TYP,'') AS TMP_AC_TYP, ");
		sql.append("	NVL(SPLR_CD,'') AS SPLR_CD, ");
		sql.append("	NVL(BPLN_YR,'') AS BPLN_YR, ");
		sql.append("	NVL(NW_ITM_NO_TYP,'') AS NW_ITM_NO_TYP, ");
		sql.append("	NVL(N_I_N_R_PLN_DT,'') AS N_I_N_R_PLN_DT, ");
		sql.append("	NVL(MFCC_CD,'') AS MFCC_CD, ");
		sql.append("	NVL(ODR_DVSN_CD,'') AS ODR_DVSN_CD, ");
		sql.append("	NVL(DSP_SPCF_CTNT,'') AS DSP_SPCF_CTNT, ");
		sql.append("	NVL(PKG_MSR,'') AS PKG_MSR, ");
		sql.append("	NVL(SLS_TRDT_CD,'') AS SLS_TRDT_CD, ");
		sql.append("	NVL(SLS_CRCY_CD,'') AS SLS_CRCY_CD, ");
		sql.append("	NVL(SLS_UP_APL_BGN_DT,'') AS SLS_UP_APL_BGN_DT, ");
		sql.append("	NVL(SLS_UP_APL_END_DT,'') AS SLS_UP_APL_END_DT, ");
		sql.append("	NVL(SLS_UP,'') AS SLS_UP, ");
		sql.append("	NVL(SLS_UP_D_L_PLC,'') AS SLS_UP_D_L_PLC, ");
		sql.append("	NVL(SLS_UP_APL_BGN_DT2,'') AS SLS_UP_APL_BGN_DT2, ");
		sql.append("	NVL(SLS_UP_APL_END_DT2,'') AS SLS_UP_APL_END_DT2, ");
		sql.append("	NVL(SLS_UP2,'') AS SLS_UP2, ");
		sql.append("	NVL(SLS_UP_D_L_PLC2,'') AS SLS_UP_D_L_PLC2, ");
		sql.append("	NVL(I_N_S_DCTN_DT,'') AS I_N_S_DCTN_DT, ");
		sql.append("	NVL(B_BPLN_ITM_NO,'') AS B_BPLN_ITM_NO, ");
		sql.append("	NVL(RPL_DVSN_CD,'') AS RPL_DVSN_CD, ");
		sql.append("	NVL(GFT_ITM_TYP,'') AS GFT_ITM_TYP, ");
		sql.append("	NVL(IMP_ITM_TYP,'') AS IMP_ITM_TYP, ");
		sql.append("	NVL(DSP_ITM_TYP,'') AS DSP_ITM_TYP, ");
		sql.append("	NVL(CNSMT_ITM_TYP,'') AS CNSMT_ITM_TYP, ");
		sql.append("	NVL(SLS_PRMT_ITM_TYP,'') AS SLS_PRMT_ITM_TYP, ");
		sql.append("	NVL(PUR_ITM_TYP,'') AS PUR_ITM_TYP, ");
		sql.append("	NVL(SLS_INNR_P_RT,'') AS SLS_INNR_P_RT, ");
		sql.append("	NVL(SLS_INNR_D_P_L_PLC,'') AS SLS_INNR_D_P_L_PLC, ");
		sql.append("	NVL(SLS_INNR_P_RND_TYP,'') AS SLS_INNR_P_RND_TYP,");
		sql.append("	NVL(SLS_STD_S_PRIZ,'') AS SLS_STD_S_PRIZ,");
		sql.append("	NVL(SLS_TMP_S_PRIZ_TYP,'') AS SLS_TMP_S_PRIZ_TYP,");
		sql.append("	NVL(SLS_ODR_QTY_STD,'') AS SLS_ODR_QTY_STD,");
		sql.append("	NVL(SLS_ODR_QTY_MAX,'') AS SLS_ODR_QTY_MAX,");
		sql.append("	NVL(SLS_ODR_QTY_MIN,'') AS SLS_ODR_QTY_MIN,");
		sql.append("	NVL(BPLN_PUR_PRIZ,'') AS BPLN_PUR_PRIZ,");
		sql.append("	NVL(BPLN_SLS_PRIZ,'') AS BPLN_SLS_PRIZ,");
		sql.append("	NVL(SLS_S_BGN_DT,'') AS SLS_S_BGN_DT,");
		sql.append("	NVL(SLS_S_END_DT,'') AS SLS_S_END_DT,");
		sql.append("	NVL(REAR_WHRS_CD,'') AS REAR_WHRS_CD,");
		sql.append("	NVL(SLS_ITM_ADM_TYP,'') AS SLS_ITM_ADM_TYP,");
		sql.append("	NVL(SLS_CAT_LRG,'') AS SLS_CAT_LRG,");
		sql.append("	NVL(SLS_CAT_MID,'') AS SLS_CAT_MID,");
		sql.append("	NVL(SLS_CAT_SML,'') AS SLS_CAT_SML,");
		sql.append("	NVL(SLS_SLS_DEPT,'') AS SLS_SLS_DEPT,");
		sql.append("	NVL(PUR_UM,'') AS PUR_UM,");
		sql.append("	NVL(INV_PUR_EXC_RT,'') AS INV_PUR_EXC_RT,");
		sql.append("	NVL(INV_UM,'') AS INV_UM,");
		sql.append("	NVL(DLVY_INV_EXC_RT,'') AS DLVY_INV_EXC_RT,");
		sql.append("	NVL(DLVY_UM,'') AS DLVY_UM,");
		sql.append("	NVL(ADD_PRIZ_TAX_CD,'') AS ADD_PRIZ_TAX_CD,");
		sql.append("	NVL(ADD_PRIZ_CAL_TYP,'') AS ADD_PRIZ_CAL_TYP,");
		sql.append("	NVL(ODR_MTHD,'') AS ODR_MTHD,");
		sql.append("	NVL(SLS_SLS_CST_AC,'') AS SLS_SLS_CST_AC,");
		sql.append("	TO_CHAR(NVL(RGS_DTTM,''),'YYYYMMDDHH24MISS') AS RGS_DTTM, ");
		sql.append("	NVL(RGS_CHRG_CD,'') AS RGS_CHRG_CD, ");
		sql.append("	NVL(RGS_PGID,'') AS RGS_PGID, ");
		sql.append("	TO_CHAR(NVL(UPD_DTTM,''),'YYYYMMDDHH24MISS') AS UPD_DTTM, ");
		sql.append("	NVL(UPD_CHRG_CD,'') AS UPD_CHRG_CD, ");
		sql.append("	NVL(UPD_PGID,'') AS UPD_PGID, ");
		sql.append("	NVL(FM_TYP,'') AS FM_TYP,");
		sql.append("	NVL(EMP1_ITM_TYP,'') AS EMP1_ITM_TYP, ");
		sql.append("	NVL(EMP2_ITM_TYP,'') AS EMP2_ITM_TYP, ");
		sql.append("	NVL(EMP3_ITM_TYP,'') AS EMP3_ITM_TYP, ");
		sql.append("	NVL(EMP4_ITM_TYP,'') AS EMP4_ITM_TYP, ");
		sql.append("	NVL(EMP5_ITM_TYP,'') AS EMP5_ITM_TYP, ");
		sql.append("	NVL(MAKER_KANSI_TYP,'') AS MAKER_KANSI_TYP, ");
		sql.append("	NVL(PSI_ITM_TYP,'') AS PSI_ITM_TYP, ");
		sql.append("	NVL(SLS_MIN_S_PRIZ,'') AS SLS_MIN_S_PRIZ, ");
		sql.append("	NVL(SLS_PUR_PRIZ,'') AS SLS_PUR_PRIZ ");
		sql.append("	FROM ");
		sql.append("	M03 ");
		sql.append("	WHERE ");
		sql.append("	UPD_DTTM > TO_DATE("+getString("UPD_DTTM_BEGIN")+",'YYYYMMDD HH24:MI:SS') ");
		sql.append("	AND ");
		sql.append("	UPD_DTTM <= TO_DATE("+getString("UPD_DTTM_END")+",'YYYYMMDD HH24:MI:SS') ");
		sql.append("	AND ");
		sql.append("        (FM_TYP =1 OR FM_TYP = 2) ");
		sql.append("    AND SLCP_CD IN('00027495','77999900','77999901')");
		sql.append("	ORDER BY ");
		sql.append("	SLCP_CD,ITM_NO,UPD_DTTM ASC ");
		sql.append("	");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		SelectResultRset srr = db.executeQuery();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return srr;
	}

	public SelectResultRset SELECT_BM0301(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append("	SELECT ");
		sql.append("	NVL(SLCP_CD,'') AS SLCP_CD,");
		sql.append("	NVL(ITM_NO,'') AS ITM_NO,");
		sql.append("	NVL(APL_BDT,'') AS APL_BDT, ");
		sql.append("	NVL(APL_EDT,'') AS APL_EDT, ");
		sql.append("	NVL(GNR_ADM_NO,'') AS GNR_ADM_NO, ");
		sql.append("	NVL(TMP_AC_TYP,'') AS TMP_AC_TYP, ");
		sql.append("	NVL(SPLR_CD,'') AS SPLR_CD, ");
		sql.append("	NVL(BPLN_YR,'') AS BPLN_YR, ");
		sql.append("	NVL(NW_ITM_NO_TYP,'') AS NW_ITM_NO_TYP, ");
		sql.append("	NVL(N_I_N_R_PLN_DT,'') AS N_I_N_R_PLN_DT, ");
		sql.append("	NVL(MFCC_CD,'') AS MFCC_CD, ");
		sql.append("	NVL(ODR_DVSN_CD,'') AS ODR_DVSN_CD, ");
		sql.append("	NVL(DSP_SPCF_CTNT,'') AS DSP_SPCF_CTNT, ");
		sql.append("	NVL(PKG_MSR,'') AS PKG_MSR, ");
		sql.append("	NVL(SLS_TRDT_CD,'') AS SLS_TRDT_CD, ");
		sql.append("	NVL(SLS_CRCY_CD,'') AS SLS_CRCY_CD, ");
		sql.append("	NVL(SLS_UP_APL_BGN_DT,'') AS SLS_UP_APL_BGN_DT, ");
		sql.append("	NVL(SLS_UP_APL_END_DT,'') AS SLS_UP_APL_END_DT, ");
		sql.append("	NVL(SLS_UP,'') AS SLS_UP, ");
		sql.append("	NVL(SLS_UP_D_L_PLC,'') AS SLS_UP_D_L_PLC, ");
		sql.append("	NVL(SLS_UP_APL_BGN_DT2,'') AS SLS_UP_APL_BGN_DT2, ");
		sql.append("	NVL(SLS_UP_APL_END_DT2,'') AS SLS_UP_APL_END_DT2, ");
		sql.append("	NVL(SLS_UP2,'') AS SLS_UP2, ");
		sql.append("	NVL(SLS_UP_D_L_PLC2,'') AS SLS_UP_D_L_PLC2, ");
		sql.append("	NVL(I_N_S_DCTN_DT,'') AS I_N_S_DCTN_DT, ");
		sql.append("	NVL(B_BPLN_ITM_NO,'') AS B_BPLN_ITM_NO, ");
		sql.append("	NVL(RPL_DVSN_CD,'') AS RPL_DVSN_CD, ");
		sql.append("	NVL(GFT_ITM_TYP,'') AS GFT_ITM_TYP, ");
		sql.append("	NVL(IMP_ITM_TYP,'') AS IMP_ITM_TYP, ");
		sql.append("	NVL(DSP_ITM_TYP,'') AS DSP_ITM_TYP, ");
		sql.append("	NVL(CNSMT_ITM_TYP,'') AS CNSMT_ITM_TYP, ");
		sql.append("	NVL(SLS_PRMT_ITM_TYP,'') AS SLS_PRMT_ITM_TYP, ");
		sql.append("	NVL(PUR_ITM_TYP,'') AS PUR_ITM_TYP, ");
		sql.append("	NVL(SLS_INNR_P_RT,'') AS SLS_INNR_P_RT, ");
		sql.append("	NVL(SLS_INNR_D_P_L_PLC,'') AS SLS_INNR_D_P_L_PLC, ");
		sql.append("	NVL(SLS_INNR_P_RND_TYP,'') AS SLS_INNR_P_RND_TYP,");
		sql.append("	NVL(SLS_STD_S_PRIZ,'') AS SLS_STD_S_PRIZ,");
		sql.append("	NVL(SLS_TMP_S_PRIZ_TYP,'') AS SLS_TMP_S_PRIZ_TYP,");
		sql.append("	NVL(SLS_ODR_QTY_STD,'') AS SLS_ODR_QTY_STD,");
		sql.append("	NVL(SLS_ODR_QTY_MAX,'') AS SLS_ODR_QTY_MAX,");
		sql.append("	NVL(SLS_ODR_QTY_MIN,'') AS SLS_ODR_QTY_MIN,");
		sql.append("	NVL(BPLN_PUR_PRIZ,'') AS BPLN_PUR_PRIZ,");
		sql.append("	NVL(BPLN_SLS_PRIZ,'') AS BPLN_SLS_PRIZ,");
		sql.append("	NVL(SLS_S_BGN_DT,'') AS SLS_S_BGN_DT,");
		sql.append("	NVL(SLS_S_END_DT,'') AS SLS_S_END_DT,");
		sql.append("	NVL(REAR_WHRS_CD,'') AS REAR_WHRS_CD,");
		sql.append("	NVL(SLS_ITM_ADM_TYP,'') AS SLS_ITM_ADM_TYP,");
		sql.append("	NVL(SLS_CAT_LRG,'') AS SLS_CAT_LRG,");
		sql.append("	NVL(SLS_CAT_MID,'') AS SLS_CAT_MID,");
		sql.append("	NVL(SLS_CAT_SML,'') AS SLS_CAT_SML,");
		sql.append("	NVL(SLS_SLS_DEPT,'') AS SLS_SLS_DEPT,");
		sql.append("	NVL(PUR_UM,'') AS PUR_UM,");
		sql.append("	NVL(INV_PUR_EXC_RT,'') AS INV_PUR_EXC_RT,");
		sql.append("	NVL(INV_UM,'') AS INV_UM,");
		sql.append("	NVL(DLVY_INV_EXC_RT,'') AS DLVY_INV_EXC_RT,");
		sql.append("	NVL(DLVY_UM,'') AS DLVY_UM,");
		sql.append("	NVL(ADD_PRIZ_TAX_CD,'') AS ADD_PRIZ_TAX_CD,");
		sql.append("	NVL(ADD_PRIZ_CAL_TYP,'') AS ADD_PRIZ_CAL_TYP,");
		sql.append("	NVL(ODR_MTHD,'') AS ODR_MTHD,");
		sql.append("	NVL(SLS_SLS_CST_AC,'') AS SLS_SLS_CST_AC,");
		sql.append("	TO_CHAR(NVL(RGS_DTTM,''),'YYYYMMDDHH24MISS') AS RGS_DTTM, ");
		sql.append("	NVL(RGS_CHRG_CD,'') AS RGS_CHRG_CD, ");
		sql.append("	NVL(RGS_PGID,'') AS RGS_PGID, ");
		sql.append("	TO_CHAR(NVL(UPD_DTTM,''),'YYYYMMDDHH24MISS') AS UPD_DTTM, ");
		sql.append("	NVL(UPD_CHRG_CD,'') AS UPD_CHRG_CD, ");
		sql.append("	NVL(UPD_PGID,'') AS UPD_PGID, ");
		sql.append("	NVL(FM_TYP,'') AS FM_TYP,");
		sql.append("	NVL(EMP1_ITM_TYP,'') AS EMP1_ITM_TYP, ");
		sql.append("	NVL(EMP2_ITM_TYP,'') AS EMP2_ITM_TYP, ");
		sql.append("	NVL(EMP3_ITM_TYP,'') AS EMP3_ITM_TYP, ");
		sql.append("	NVL(EMP4_ITM_TYP,'') AS EMP4_ITM_TYP, ");
		sql.append("	NVL(EMP5_ITM_TYP,'') AS EMP5_ITM_TYP, ");
		sql.append("	NVL(MAKER_KANSI_TYP,'') AS MAKER_KANSI_TYP, ");
		sql.append("	NVL(PSI_ITM_TYP,'') AS PSI_ITM_TYP, ");
		sql.append("	NVL(SLS_MIN_S_PRIZ,'') AS SLS_MIN_S_PRIZ, ");
		sql.append("	NVL(SLS_PUR_PRIZ,'') AS SLS_PUR_PRIZ ");
		sql.append("	FROM ");
		sql.append("	BM03 ");
		sql.append("	WHERE ");
		sql.append("	SLCP_CD "+((getString("SLCP_CD").equals(""))?" is null ":"=")+getString("SLCP_CD")+" ");
		sql.append("	AND ");
		sql.append("	ITM_NO "+((getString("ITM_NO").equals(""))?" is null ":"=")+getString("ITM_NO")+" ");
		sql.append("	AND ");
		sql.append("	UPD_DTTM > TO_DATE("+getString("UPD_DTTM_BEGIN")+",'YYYYMMDD HH24:MI:SS') ");
		sql.append("	AND ");
		sql.append("	UPD_DTTM <= TO_DATE("+getString("UPD_DTTM_END")+",'YYYYMMDD HH24:MI:SS') ");
		sql.append("	AND ");
		sql.append("        (FM_TYP =1 OR FM_TYP = 2) ");
		sql.append("	ORDER BY ");
		sql.append("	SLCP_CD,ITM_NO,UPD_DTTM ASC ");
		sql.append("	");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		SelectResultRset srr = db.executeQuery();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return srr;
	}

	public SelectResultRset SELECT_M2101(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append("	SELECT ");
		sql.append("	NVL(CD_NM_CN,'') AS CD_NM_CN ");
		sql.append("	FROM ");
		sql.append("	M21 ");
		sql.append("	WHERE  ");
		sql.append("	CD_TYP_CD "+((getString("CD_TYP_CD").equals(""))?" is null ":"=")+getString("CD_TYP_CD")+" ");
		sql.append("	AND");
		sql.append("	CD_VALUE "+((getString("CD_VALUE").equals(""))?" is null ":"=")+getString("CD_VALUE")+"");
		sql.append("	AND");
		sql.append("	CTRL_DVSN_CD "+((getString("CTRL_DVSN_CD").equals(""))?" is null ":"=")+getString("CTRL_DVSN_CD")+"");
		sql.append("	AND");
		sql.append("	FM_TYP <> "+getString("FM_TYP_6")+"");
		sql.append("	AND");
		sql.append("	FM_TYP <> "+getString("FM_TYP_9")+"");
		sql.append("	AND");
		sql.append("	APL_BDT <"+((getString("SYS_DATE").equals(""))?" is null ":"=")+getString("SYS_DATE")+"");
		sql.append("	");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		SelectResultRset srr = db.executeQuery();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return srr;
	}

	public SelectResultRset SELECT_MAILLIST(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append("       SELECT ");
		sql.append("       NVL(USER_ID,'') AS USER_ID, ");
		sql.append("       NVL(ODR_DVSN_CD,'') AS ODR_DVSN_CD,");
		sql.append("       NVL(ELCT_MAIL_ADR,'') AS ELCT_MAIL_ADR,");
		sql.append("       NVL(MAIL_TYP,'') AS MAIL_TYP ");
		sql.append("       FROM ");
		sql.append("       MAILADD ");
		sql.append("       WHERE ");
		sql.append("       MAIL_TYP = '2' ");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		SelectResultRset srr = db.executeQuery();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return srr;
	}

	public SelectResultRset SELECT_USR01(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append("	SELECT ");
		sql.append("	NVL(USER_NAME,'') AS USER_NAME ");
		sql.append("	FROM ");
		sql.append("	USR ");
		sql.append("	WHERE  ");
		sql.append("	USER_AB_ID "+((getString("USER_AB_ID").equals(""))?" is null ":"=")+getString("USER_AB_ID")+" ");
		sql.append("	AND ROWNUM = 1");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		SelectResultRset srr = db.executeQuery();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return srr;
	}

	public SelectResultRset SELECT_BM0303(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append("	SELECT ");
		sql.append("	NVL(SLCP_CD,'') AS SLCP_CD,");
		sql.append("	NVL(ITM_NO,'') AS ITM_NO,");
		sql.append("	NVL(APL_BDT,'') AS APL_BDT, ");
		sql.append("	NVL(APL_EDT,'') AS APL_EDT, ");
		sql.append("	NVL(GNR_ADM_NO,'') AS GNR_ADM_NO, ");
		sql.append("	NVL(TMP_AC_TYP,'') AS TMP_AC_TYP, ");
		sql.append("	NVL(SPLR_CD,'') AS SPLR_CD, ");
		sql.append("	NVL(BPLN_YR,'') AS BPLN_YR, ");
		sql.append("	NVL(NW_ITM_NO_TYP,'') AS NW_ITM_NO_TYP, ");
		sql.append("	NVL(N_I_N_R_PLN_DT,'') AS N_I_N_R_PLN_DT, ");
		sql.append("	NVL(MFCC_CD,'') AS MFCC_CD, ");
		sql.append("	NVL(ODR_DVSN_CD,'') AS ODR_DVSN_CD, ");
		sql.append("	NVL(DSP_SPCF_CTNT,'') AS DSP_SPCF_CTNT, ");
		sql.append("	NVL(PKG_MSR,'') AS PKG_MSR, ");
		sql.append("	NVL(SLS_TRDT_CD,'') AS SLS_TRDT_CD, ");
		sql.append("	NVL(SLS_CRCY_CD,'') AS SLS_CRCY_CD, ");
		sql.append("	NVL(SLS_UP_APL_BGN_DT,'') AS SLS_UP_APL_BGN_DT, ");
		sql.append("	NVL(SLS_UP_APL_END_DT,'') AS SLS_UP_APL_END_DT, ");
		sql.append("	NVL(SLS_UP,'') AS SLS_UP, ");
		sql.append("	NVL(SLS_UP_D_L_PLC,'') AS SLS_UP_D_L_PLC, ");
		sql.append("	NVL(SLS_UP_APL_BGN_DT2,'') AS SLS_UP_APL_BGN_DT2, ");
		sql.append("	NVL(SLS_UP_APL_END_DT2,'') AS SLS_UP_APL_END_DT2, ");
		sql.append("	NVL(SLS_UP2,'') AS SLS_UP2, ");
		sql.append("	NVL(SLS_UP_D_L_PLC2,'') AS SLS_UP_D_L_PLC2, ");
		sql.append("	NVL(I_N_S_DCTN_DT,'') AS I_N_S_DCTN_DT, ");
		sql.append("	NVL(B_BPLN_ITM_NO,'') AS B_BPLN_ITM_NO, ");
		sql.append("	NVL(RPL_DVSN_CD,'') AS RPL_DVSN_CD, ");
		sql.append("	NVL(GFT_ITM_TYP,'') AS GFT_ITM_TYP, ");
		sql.append("	NVL(IMP_ITM_TYP,'') AS IMP_ITM_TYP, ");
		sql.append("	NVL(DSP_ITM_TYP,'') AS DSP_ITM_TYP, ");
		sql.append("	NVL(CNSMT_ITM_TYP,'') AS CNSMT_ITM_TYP, ");
		sql.append("	NVL(SLS_PRMT_ITM_TYP,'') AS SLS_PRMT_ITM_TYP, ");
		sql.append("	NVL(PUR_ITM_TYP,'') AS PUR_ITM_TYP, ");
		sql.append("	NVL(SLS_INNR_P_RT,'') AS SLS_INNR_P_RT, ");
		sql.append("	NVL(SLS_INNR_D_P_L_PLC,'') AS SLS_INNR_D_P_L_PLC, ");
		sql.append("	NVL(SLS_INNR_P_RND_TYP,'') AS SLS_INNR_P_RND_TYP,");
		sql.append("	NVL(SLS_STD_S_PRIZ,'') AS SLS_STD_S_PRIZ,");
		sql.append("	NVL(SLS_TMP_S_PRIZ_TYP,'') AS SLS_TMP_S_PRIZ_TYP,");
		sql.append("	NVL(SLS_ODR_QTY_STD,'') AS SLS_ODR_QTY_STD,");
		sql.append("	NVL(SLS_ODR_QTY_MAX,'') AS SLS_ODR_QTY_MAX,");
		sql.append("	NVL(SLS_ODR_QTY_MIN,'') AS SLS_ODR_QTY_MIN,");
		sql.append("	NVL(BPLN_PUR_PRIZ,'') AS BPLN_PUR_PRIZ,");
		sql.append("	NVL(BPLN_SLS_PRIZ,'') AS BPLN_SLS_PRIZ,");
		sql.append("	NVL(SLS_S_BGN_DT,'') AS SLS_S_BGN_DT,");
		sql.append("	NVL(SLS_S_END_DT,'') AS SLS_S_END_DT,");
		sql.append("	NVL(REAR_WHRS_CD,'') AS REAR_WHRS_CD,");
		sql.append("	NVL(SLS_ITM_ADM_TYP,'') AS SLS_ITM_ADM_TYP,");
		sql.append("	NVL(SLS_CAT_LRG,'') AS SLS_CAT_LRG,");
		sql.append("	NVL(SLS_CAT_MID,'') AS SLS_CAT_MID,");
		sql.append("	NVL(SLS_CAT_SML,'') AS SLS_CAT_SML,");
		sql.append("	NVL(SLS_SLS_DEPT,'') AS SLS_SLS_DEPT,");
		sql.append("	NVL(PUR_UM,'') AS PUR_UM,");
		sql.append("	NVL(INV_PUR_EXC_RT,'') AS INV_PUR_EXC_RT,");
		sql.append("	NVL(INV_UM,'') AS INV_UM,");
		sql.append("	NVL(DLVY_INV_EXC_RT,'') AS DLVY_INV_EXC_RT,");
		sql.append("	NVL(DLVY_UM,'') AS DLVY_UM,");
		sql.append("	NVL(ADD_PRIZ_TAX_CD,'') AS ADD_PRIZ_TAX_CD,");
		sql.append("	NVL(ADD_PRIZ_CAL_TYP,'') AS ADD_PRIZ_CAL_TYP,");
		sql.append("	NVL(ODR_MTHD,'') AS ODR_MTHD,");
		sql.append("	NVL(SLS_SLS_CST_AC,'') AS SLS_SLS_CST_AC,");
		sql.append("	TO_CHAR(NVL(RGS_DTTM,''),'YYYYMMDDHH24MISS') AS RGS_DTTM, ");
		sql.append("	NVL(RGS_CHRG_CD,'') AS RGS_CHRG_CD, ");
		sql.append("	NVL(RGS_PGID,'') AS RGS_PGID, ");
		sql.append("	TO_CHAR(NVL(UPD_DTTM,''),'YYYYMMDDHH24MISS') AS UPD_DTTM, ");
		sql.append("	NVL(UPD_CHRG_CD,'') AS UPD_CHRG_CD, ");
		sql.append("	NVL(UPD_PGID,'') AS UPD_PGID, ");
		sql.append("	NVL(FM_TYP,'') AS FM_TYP,");
		sql.append("	NVL(EMP1_ITM_TYP,'') AS EMP1_ITM_TYP, ");
		sql.append("	NVL(EMP2_ITM_TYP,'') AS EMP2_ITM_TYP, ");
		sql.append("	NVL(EMP3_ITM_TYP,'') AS EMP3_ITM_TYP, ");
		sql.append("	NVL(EMP4_ITM_TYP,'') AS EMP4_ITM_TYP, ");
		sql.append("	NVL(EMP5_ITM_TYP,'') AS EMP5_ITM_TYP, ");
		sql.append("	NVL(MAKER_KANSI_TYP,'') AS MAKER_KANSI_TYP, ");
		sql.append("	NVL(PSI_ITM_TYP,'') AS PSI_ITM_TYP, ");
		sql.append("	NVL(SLS_MIN_S_PRIZ,'') AS SLS_MIN_S_PRIZ, ");
		sql.append("	NVL(SLS_PUR_PRIZ,'') AS SLS_PUR_PRIZ ");
		sql.append("	FROM ");
		sql.append("	BM03 ");
		sql.append("	WHERE ");
		sql.append("	SLCP_CD "+((getString("SLCP_CD").equals(""))?" is null ":"=")+getString("SLCP_CD")+" ");
		sql.append("	AND ");
		sql.append("	ITM_NO "+((getString("ITM_NO").equals(""))?" is null ":"=")+getString("ITM_NO")+" ");
		sql.append("	AND ");
		sql.append("	UPD_DTTM <= TO_DATE("+getString("UPD_DTTM_BEGIN")+",'YYYYMMDD HH24:MI:SS') ");
		sql.append("	AND ");
		sql.append("        (FM_TYP =1 OR FM_TYP = 2) ");
		sql.append("	ORDER BY ");
		sql.append("	UPD_DTTM DESC ");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		SelectResultRset srr = db.executeQuery();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return srr;
	}


	public void setUPD_DTTM_BEGIN(String value){
		if(value==null) {
			paramsString.remove("UPD_DTTM_BEGIN");
			return;
		}
		paramsString.put("UPD_DTTM_BEGIN",value);
	}


	public void setUPD_DTTM_END(String value){
		if(value==null) {
			paramsString.remove("UPD_DTTM_END");
			return;
		}
		paramsString.put("UPD_DTTM_END",value);
	}


	public void setSLCP_CD(String value){
		if(value==null) {
			paramsString.remove("SLCP_CD");
			return;
		}
		paramsString.put("SLCP_CD",value);
	}


	public void setITM_NO(String value){
		if(value==null) {
			paramsString.remove("ITM_NO");
			return;
		}
		paramsString.put("ITM_NO",value);
	}


	public void setCD_TYP_CD(String value){
		if(value==null) {
			paramsString.remove("CD_TYP_CD");
			return;
		}
		paramsString.put("CD_TYP_CD",value);
	}


	public void setCD_VALUE(String value){
		if(value==null) {
			paramsString.remove("CD_VALUE");
			return;
		}
		paramsString.put("CD_VALUE",value);
	}


	public void setCTRL_DVSN_CD(String value){
		if(value==null) {
			paramsString.remove("CTRL_DVSN_CD");
			return;
		}
		paramsString.put("CTRL_DVSN_CD",value);
	}


	public void setFM_TYP_6(String value){
		if(value==null) {
			paramsString.remove("FM_TYP_6");
			return;
		}
		paramsString.put("FM_TYP_6",value);
	}


	public void setFM_TYP_9(String value){
		if(value==null) {
			paramsString.remove("FM_TYP_9");
			return;
		}
		paramsString.put("FM_TYP_9",value);
	}


	public void setSYS_DATE(String value){
		if(value==null) {
			paramsString.remove("SYS_DATE");
			return;
		}
		paramsString.put("SYS_DATE",value);
	}


	public void setUSER_AB_ID(String value){
		if(value==null) {
			paramsString.remove("USER_AB_ID");
			return;
		}
		paramsString.put("USER_AB_ID",value);
	}


}
